package com.mark.singletableproject.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mark.singletableproject.entity.China;
import com.mark.singletableproject.mapper.ChinaMapper;
import com.mark.singletableproject.service.ChinaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChinaServiceImpl extends ServiceImpl<ChinaMapper, China> implements ChinaService {

    @Autowired
    private ChinaMapper chinaMapper;
    /**
     * 动态 sql
     */

    /**
     * 单条插入
     * @param china
     */
    @Override
    public void aSingleInsert(China china) {
        chinaMapper.insertOne(china);
    }

    /**
     * 批量插入
     * @param chinaList
     */
    @Override
    public void bulkInsert(List<China> chinaList) {
        chinaMapper.bulkInsert(chinaList);
    }

    /**
     * 单条更新
     * @param china
     */
    @Override
    public void aSingleUpdat(China china) {
        chinaMapper.aSingleUpdat(china);
    }

    /**
     * 批量更新
     * @param chinaList
     */
    @Override
    public void batchUpdate(List<China> chinaList) {
        chinaMapper.batchUpdate(chinaList);
    }

    @Override
    public List<China> chinaListByVillageName(List<String> villageNameS) {
        return chinaMapper.chinaListByVillageName(villageNameS);
    }


}
